﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Macds.Core.XML.Excel
{
    public class ExcelRow : ExcelBase
    {
        public ExcelCellsCollection Cells { get; set; }

        public ExcelRow()
        {
            this.Cells = new ExcelCellsCollection();
        }

        public ExcelRow(object[] objects)
        {
            this.Cells = new ExcelCellsCollection();
            foreach (object obj in objects)
            {
                this.Cells.Add(new ExcelCell(obj.ToString()));
            }
        }

        public override string ToString()
        {
            StringBuilder content = new StringBuilder();
            content.Append("<ss:Row>\r\n");

            foreach (ExcelCell cell in this.Cells)
            {
                content.Append(cell.ToString());
            }

            content.Append("</ss:Row>\r\n");
            return content.ToString();
        }
    }
}
